#include "accelerometer.h"
#include "h01.h"
#include "power.h"
#include "rtc.h"

uint	curSteps;
uint	timer;
ushort	error;
ushort	flags;
ubyte	clrSteps;
ubyte	lowPower;
ubyte	status;

DEBUG	debug;

SAVE	savRam;

void main(void){
	while(1){
		switch(status){
		case STATUS_BOOTING:
			booting();
			break;
		case STATUS_CHARGING:
			charging();
			break;
		case STATUS_CLOCK:
			clock();
			break;
		case STATUS_PEDOMETER:
			pedometer();
			break;
		case STATUS_POWERDOWN:
			powerDown();
			break;
		case STATUS_SILENT:
		case STATUS_STANDBY:
			silent(status);
			break;
		default:
			status=getStatus();
		}
	}
}